/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package src.services.security;

import java.io.Serializable;
import java.util.List;
import src.domain.security.Ugpolicy;
import src.domain.security.Ugroup;
import src.services.CRUEDService;

/**
 *
 * @author Yusup Jauhari Shandi <chan at In.Visi Forever!>
 */
public class UgpolicyModel implements Serializable{
    private CRUEDService service;

    public UgpolicyModel() {
        service = new  CRUEDService();
    }
    
     public List<Ugpolicy> findAll() {
        return (List<Ugpolicy>) service.findAll("Ugpolicy",null);
    }

    public boolean saveData(Ugpolicy data) {
        return service.saveData(data);
    }
    
    public boolean deleteData(Ugpolicy data) {
        return service.deleteData(data);
    }
    
     public String getAllowAction(Integer menuId, Integer groupId) {
        return (String) service.getObjectSQLdirect("SELECT ALLOWED_ACTIONS FROM UGPOLICY WHERE USERGROUP_ID ="+groupId+"  AND MENU_ID ="+menuId);
    }
    
    
    
}
